import request from '@/config/axios'

export interface ProductionTaskOrderVO {
  creatorName: string
  workTaskNumber: string
  productNumber: string
  productName: string
  productStandard: string
  productDrawingNumber: string
  orderQuantity: number
  serialNumber: string
  partNumber: string
  partName: string
  partDrawingNumber: string
  partSpecification: string
  material: string
  specification: string
  plannedQuantity: number
  processName: string
  typeOfWork: string
  cuttingType: string
  machiningProcess: string
  productionTeam: string
  deviceName: string
  deviceCode: string
  operator: string
  planStartDate: Date
  planEndDate: Date
  warehousePosition: string
  productiveTaskStatus: number
  internalWork: number
  outsourcing: number
  outsidePurchase: number
  taskNumber: number
  netSizeLength: number
  netSizeWidth: number
  cuttingSizeLength: number
  cuttingSizeWidth: number
  dictIsMachine: number
  jobNumber: string
  basicDosage: number
}

// 查询生产管理-工单管理-生产派工审核列表
export const getProductionDispatchingAuditPage = async (params) => {
  return await request.get({ url: `/produce/production-dispatching-audit/page`, params })
}

// 查询生产管理-工单管理-生产派工审核列表(id查询)
export const getProductionDispatchingAuditList = async (ids) => {
  return await request.get({ url: `/produce/production-dispatching-audit/list?ids=`+ ids })
}

// 查询生产管理-工单管理-生产派工审核详情
export const getProductionDispatchingAudit = async (id: number) => {
  return await request.get({ url: `/produce/production-dispatching-audit/get?id=` + id })
}

// // 审核
// export const postProductionDispatchingAudit = async (ids) => {
//   return await request.post({ url: `/produce/production-dispatching-audit/audit?ids=`+ ids})
// }

// 审核
export const putExamine = async (data) => {
    return await request.put({ url: `/produce/production-task-order/examine`, data})
}
    
// 退回
export const postProductionDispatchingAuditBack = async (ids) => {
  return await request.post({ url: `/produce/production-dispatching-audit/back?ids=`+ ids })
}

// 导出生产管理-工单管理-生产派工审核Excel
export const exportProductionDispatchingAudit = async (data) => {
  return await request.download({ url: `/produce/production-dispatching-audit/export-excel`, data })
}

// 修改生产管理-工单管理-生产派工审核
export const updateProductionDispatchingAudit = async (data: ProductionTaskOrderVO) => {
  return await request.put({ url: `/produce/production-dispatching-audit/update`, data })
}
